<% if(datatype.properties.length > 0 || !(datatype.name.endsWith("Request") || datatype.name.endsWith("Result"))) { %>
    <% if(datatype.description) { %>
    /// <summary>
    /// <%- GetDescriptionClean(datatype.description) %>
    /// </summary><% } %>
<%- GetDeprecationAttribute("    ", datatype)
%>    <%- GetModelAccessibility(datatype) %> class <%- datatype.name %><% if(datatype.sortKey) { %> : IComparable<<%- datatype.name %>><% } %>
    {    <% if(datatype.properties.length > 0 && datatype.name.endsWith("Request")) { %>
        public <%- datatype.name %>()
        {
        }

        public <%- datatype.name %>(<%- JoinParams(datatype, true, true, false) %>)
        {<% for(var i in datatype.properties) { var property = datatype.properties[i] %>
            <%- property.name %> = in<%- property.name %>; <% } %>
        }<% } %><% for(var i in datatype.properties) { var property = datatype.properties[i] %>
        <% if(property.description) { %>
        /// <summary>
        /// <%- GetDescriptionClean(property.description) %>
        /// </summary><% } %>
        <%- GetPropertyAttribs(property, datatype, api) %>public <%- getPropertyDef(property, datatype) %>;<% } %>
        <% if(datatype.sortKey) { %>
        public int CompareTo(<%- datatype.name %> other)
        {
            if (other == null || other.<%- datatype.sortKey%> == null) return 1;
            if (<%- datatype.sortKey%> == null) return -1;
            return <%- datatype.sortKey%>.CompareTo(other.<%- datatype.sortKey%>);
        }<% } %>
    }
<% } %>
